<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="6" :sm="8">
            <a-form-item label="销售订单号">
              <a-input placeholder="销售订单号" v-model="queryParam.soNo"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
            <a-form-item label="生产订单号">
              <a-input placeholder="生产订单号" v-model="queryParam.ipoNo"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8" >
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->
    
    <!-- 操作按钮区域 -->
    <div class="table-operator">
    </div>

    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>

      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="xh"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange">
        <span slot="action" slot-scope="text, record">
          <a @click="handleDetail(record)">详情</a>
        </span>

      </a-table>
    </div>

    <zxjEipScdd-modal ref="modalForm"></zxjEipScdd-modal>
  </a-card>
</template>

<script>

  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import ZxjEipScddModal from './modules/ZxjEipScddModal'
  export default {
    name: "ZxjEipScddList",
    mixins:[JeecgListMixin],
    components: {
      ZxjEipScddModal
    },
    data () {
      return {
        description: '生产订单管理页面',
        // 表头
        columns: [
          {
            title: '序号',
            dataIndex: 'xh',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
          },
          {
            title:'生产订单号',
            align:"center",
            dataIndex: 'ipoNo'
          },
          {
            title:'采购方总部编码',
            align:"center",
            dataIndex: 'purchaserHqCode'
          },
          {
            title:'订单类型',
            align:"center",
            dataIndex: 'ipoType',
            customRender:function (t,r,index) {
              if(t==='1'){
                return '二次屏柜';
              }else {
                return '二次装置';
              }
            }
          },
          {
            title:'供应商编码',
            align:"center",
            dataIndex: 'supplierCode'
          },
          {
            title:'品类编码',
            align:"center",
            dataIndex: 'categoryCode'
          },
          {
            title:'种类编码',
            align:"center",
            dataIndex: 'subclassCode'
          },
          {
            title:'是否推送',
            align:"center",
            dataIndex: 'ioflag',
            customRender:function (t,r,index) {
              if(t==='1'){
                return '未推送';
              }else {
                return '已推送';
              }
            }
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            scopedSlots: { customRender: 'action' },
          }
        ],
        url: {
          list: "/zxjEipScdd/list"
        },
        dictOptions:{
        } 
      }
    },
    methods: {
      initDictConfig(){
      },
      handleDetail(record){
        this.$refs.modalForm.addModal(record);
        this.$refs.modalForm.title="生产订单详细信息";
        // getAction(that.url.detail,record.orderId).then((res) => {
        //   if (res.success) {
        //     this.$refs.modalForm.addModal(res.data);
        //     this.$refs.modalForm.title="生产订单详细信息";
        //   } else {
        //     that.$message.warning(res.message);
        //   }
        // });

      }
       
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>